home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / X-Ray / Includes / X_Ray.h < prev   
Encoding:
Text File  |  1999-06-07  |  5.4 KB  |  111 lines  |  [TEXT/CWIE]

  1. // Copyright (C) 1999 Eric Roccasecca.  All rights reserved.
  2.  
  3. #include <QDOffscreen.h>
  4.  
  5.  
  6. // Use this to determine if the X-Ray INIT loaded.  You should ignore the long gestalt value.
  7. // Just check the function result for noErr, if noErr then you are good to go.  You should
  8. // also compare the symbol IsXRayLibInstalled to nil to check if X-RayLib is available.
  9. // See below for more info.
  10. #define kX_RayGestalt            'XRay'
  11.  
  12.  
  13. // X-Ray External Errors
  14. enum {
  15.     kX_RayExtensionNotFoundError            = 100,
  16.     kX_RayAppNotInitializedCorrectlyError    = 101
  17. };
  18.  
  19.  
  20. //--------------------------------------------
  21. //    X-RAY TRANSPARENT WINDOW ROUTINES
  22. //--------------------------------------------
  23.  
  24. // DO NOT EVER CALL THIS FUNCTION
  25. // You can determine if X-RayLib is installed by comparing this fucntion's symbol to nil
  26. // Example:
  27. //        if (IsXRayLibInstalled == nil)    // this gracefully checks for X-RayLib
  28. //            return;                        // Notice this is NOT a function call, it is a symbol comparison.
  29. // If you actually call this function and X-RayLib is not available your code will crash.
  30. void IsXRayLibInstalled (void);
  31.  
  32. // Initializes X-Ray so an application can use transparent windows
  33. // Should be called as soon as possible after InitWindows()
  34. // If result is anything other than noErr, no X-Ray routines may be called
  35. OSErr InitTransparentWindows (void);
  36.  
  37. // Makes a new transparent window
  38. WindowPtr NewTransparentWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
  39.  
  40. // Gets a new transparent window from a resource file
  41. // 'WIND' resource MUST designate the window is not visible
  42. WindowPtr GetNewTransparentWindow (short windowID, void *wStorage, WindowPtr behind, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
  43.  
  44. // Makes a new transparent dialog window
  45. DialogPtr NewTransparentDialog (void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
  46.  
  47. // Gets a new transparent dialog window from a resource file
  48. // 'DLOG' resource MUST designate the window is not visible
  49. DialogPtr GetNewTransparentDialog (short dialogID, void *dStorage, WindowPtr behind, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
  50.  
  51. // Makes a new transparent TSM service window
  52. OSErr NewTransparentServiceWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, ComponentInstance ts, WindowPtr *window, RgnHandle transRgn, RGBColor *clearColor);
  53.  
  54. // Makes an existing TSM service window transparent
  55. OSErr MakeServiceWindowTransparent (WindowPtr theWindow, Boolean visible, WindowPtr behind, ComponentInstance ts, RgnHandle transRgn, RGBColor *clearColor);
  56.  
  57. // Behaves like CloseWindow for transparent windows
  58. void CloseTransparentWindow (WindowPtr theWindow);
  59.  
  60. // Behaves like DisposeWindow for transparent windows
  61. void DisposeTransparentWindow (WindowPtr theWindow);
  62.  
  63. // Behaves like CloseDialog for transparent dialog windows
  64. void CloseTransparentDialog (DialogPtr theDialog);
  65.  
  66. // Behaves like DisposeDialog for transparent dialog windows
  67. void DisposeTransparentDialog (DialogPtr theDialog);
  68.  
  69. // Behaves like CloseServiceWindow for transparent TSM service windows
  70. OSErr CloseTransparentServiceWindow (WindowPtr theWindow);
  71.  
  72. // Returns the content offscreen GWorld of a transparent window
  73. GWorldPtr GetTransparentWindowContentGWorld (WindowPtr theWindow);
  74.  
  75. // forces update of a transparent window
  76. // used mainly after content has been updated after using GetTransparentWindowContentBuffer
  77. // This should *not* be used in response to update events because this routine will cause another update event to occur
  78. // and seriaously affect the performance of your software, as well as look really bad.
  79. // if updateRgn is nil, enire window is updated
  80. // note, this works by triggering an internal transparent update event
  81. // and by invalidating the updateRgn passed to the function in theWindow
  82. // so your own event handler will eventually receive an updateEvent
  83. void UpdateTransparentWindow (WindowPtr theWIndow, RgnHandle updateRgn);
  84.  
  85. // Returns true if window is a transparent window
  86. Boolean    IsWindowTransparent (WindowPtr theWindow);
  87.  
  88. // <<< PARTIALLY IMPLEMENTED >>>
  89. // Sets the clear color and thus the clear area of a transparent window
  90. void SetTransparentWindowClearColor (WindowPtr theWindow, RGBColor *newClearColor);
  91.  
  92. // <<< PARTIALLY IMPLEMENTED >>>
  93. // Removes the clear color and thus the clear area of a transparent window
  94. void RemoveTransparentWindowClearColor (WindowPtr theWindow);
  95.  
  96. // <<< PARTIALLY IMPLEMENTED >>>
  97. // Limits area of window that is transparent instead of entire content region
  98. void SetTransparentWindowTransparentRegion (WindowPtr theWindow, RgnHandle transRgn);
  99.  
  100. // <<< PARTIALLY IMPLEMENTED >>>
  101. // Restores default transparent area which is entire content region
  102. void RemoveTransparentWindowTransparentRegion (WindowPtr theWindow);
  103.  
  104. // <<< PARTIALLY IMPLEMENTED >>>
  105. // Sets the level of transparency for a window
  106. void SetWindowTransparency (unsigned short transparency, WindowPtr theWindow);
  107.  
  108. // Returns the transparency value for a window
  109. // any return result other than noErr should be considered a failure
  110. OSErr GetWindowTransparency (unsigned short *transparency, WindowPtr theWindow);
  111.